(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 13.2' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     33849,        979]
NotebookOptionsPosition[     32309,        951]
NotebookOutlinePosition[     32708,        967]
CellTagsIndexPosition[     32665,        964]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
 RowBox[{"Clear", "[", "\"\<Global`*\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetDirectory", "[", 
   RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"fileNameL", "=", 
    RowBox[{"FileNameJoin", "[", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"StringDrop", "[", 
        RowBox[{
         RowBox[{"Directory", "[", "]"}], ",", 
         RowBox[{"-", "5"}]}], "]"}], ",", 
       "\"\<Data/Split_Aversion_lower_bound.csv\>\""}], "}"}], "]"}]}], ";"}],
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{
   "Determine", " ", "the", " ", "bound", " ", "where", " ", "the", " ", 
    "first", " ", "court", " ", "will", " ", "choose", " ", "between", " ", 
    "always", " ", "picking", " ", "lib", " ", "and", " ", "an", " ", 
    "informative", " ", "con"}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Eta]L", "=", 
    FractionBox[
     RowBox[{
      RowBox[{"x", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "p"}], "+", "1"}], ")"}], "*", "l"}], "+", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}], ")"}]}],
       "-", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "p"}], "-", "1"}], ")"}], "l"}], "+", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "p"}], "+", "1"}], ")"}], "*", "k"}]}], ")"}]}], "+", 
      RowBox[{"y1", "*", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], 
       RowBox[{"(", 
        RowBox[{"l", "-", "k"}], ")"}]}]}], 
     RowBox[{"p", 
      RowBox[{"(", 
       RowBox[{"l", "+", 
        RowBox[{"k", "*", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}], ")"}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Eta]_con", " ", 
     RowBox[{"(", "lower", ")"}]}], ",", " ", 
    RowBox[{"y1", ">", "y2"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Eta]U", "=", " ", 
    FractionBox[
     RowBox[{
      RowBox[{"2", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"l", "*", "x"}], "-", 
         RowBox[{"k", "*", "\[CapitalOmega]"}]}], ")"}]}], "+", 
      RowBox[{"y1", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], 
       RowBox[{"(", 
        RowBox[{"l", "-", "k"}], ")"}]}]}], 
     RowBox[{"l", "-", 
      RowBox[{"k", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}]]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Eta]_con", " ", 
     RowBox[{"(", "upper", ")"}]}], ",", " ", 
    RowBox[{"y1", ">", "y2"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Upsilon]L", "=", " ", 
    RowBox[{"Round", "[", 
     RowBox[{
      RowBox[{"x", "-", 
       RowBox[{"\[CapitalOmega]", "*", 
        FractionBox[
         RowBox[{
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "-", 
          "k"}], 
         RowBox[{"l", "-", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}], 
      ",", "0.0001"}], "]"}]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{"\[Upsilon]_lib", " ", 
    RowBox[{"(", "lower", ")"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Upsilon]U", " ", "=", 
    RowBox[{"Round", "[", " ", 
     RowBox[{
      RowBox[{"x", "+", 
       RowBox[{"\[CapitalOmega]", "*", 
        FractionBox[
         RowBox[{
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", 
          "k"}], 
         RowBox[{"l", "+", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}], 
      ",", "0.0001"}], "]"}]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{"\[Upsilon]_lib", " ", 
    RowBox[{"(", "upper", ")"}]}], "*)"}]}], "\[IndentingNewLine]"}], "Input",\

 CellChangeTimes->{{3.9412973885619783`*^9, 3.941297452278665*^9}, {
   3.941297501961192*^9, 3.941297514012001*^9}, {3.941297617528672*^9, 
   3.9412976550795383`*^9}, {3.941297871638508*^9, 3.9412979638451633`*^9}, {
   3.9412982026327*^9, 3.941298261431922*^9}, {3.94129873492362*^9, 
   3.941298737773205*^9}, {3.941299047153089*^9, 3.941299163708432*^9}, {
   3.941299481173521*^9, 3.941299484019787*^9}, {3.941299578692587*^9, 
   3.9412996154841337`*^9}, {3.9412996734221087`*^9, 3.941299674464138*^9}, {
   3.9413000441334543`*^9, 3.9413000444881773`*^9}, {3.9413015323662252`*^9, 
   3.941301534146428*^9}, 3.9413139690976343`*^9, {3.941562737766728*^9, 
   3.941562788798688*^9}, {3.9415643804295588`*^9, 3.941564380737213*^9}, {
   3.94156494552973*^9, 3.941564945937149*^9}, {3.941636435754298*^9, 
   3.941636456177505*^9}, {3.941636529964381*^9, 3.9416365301906633`*^9}, {
   3.94163668046397*^9, 3.9416367028876038`*^9}, {3.941638902888667*^9, 
   3.941638918410672*^9}, 3.952864538549939*^9, {3.952864589607687*^9, 
   3.952864590863014*^9}, {3.952888644711211*^9, 3.952888645111751*^9}, {
   3.952888706951064*^9, 3.9528887793351994`*^9}, {3.9528889545549927`*^9, 
   3.9528889631163187`*^9}, {3.952956674808886*^9, 3.952956682204932*^9}, {
   3.953109340397184*^9, 3.953109494435301*^9}},
 CellLabel->
  "In[243]:=",ExpressionUUID->"7d4ec211-9b62-4935-a3bd-c472162f6f2f"],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"y11", " ", "=", " ", 
    RowBox[{"x", "-", 
     RowBox[{"\[CapitalOmega]", "*", 
      FractionBox[
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "-", "k"}], 
       RowBox[{"l", "-", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}]}], 
   ";"}], "  ", 
  RowBox[{"(*", 
   RowBox[{"y2", "<", 
    RowBox[{"\[Eta]_con", " ", 
     RowBox[{"(", "lower", ")"}]}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y12", "=", " ", 
    FractionBox[
     RowBox[{
      RowBox[{"l", "*", "x"}], "-", 
      RowBox[{"y2", "*", "p", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "k"}], "-", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "-", 
         RowBox[{"2", "*", "k", "*", "p", "*", 
          RowBox[{"(", 
           RowBox[{"1", "-", "p"}], ")"}]}]}], ")"}]}]}], 
     RowBox[{"l", "-", 
      RowBox[{"k", "*", "p", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "*", "p"}], "-", "1"}], ")"}]}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{"\[Eta]_con", " ", 
      RowBox[{"(", "lower", ")"}]}], "<", "y2", "<", 
     RowBox[{"\[Eta]_con", " ", 
      RowBox[{"(", "upper", ")"}]}]}], ",", 
    RowBox[{"y1", ">", "y2"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y13", " ", "=", " ", 
    RowBox[{"x", "-", 
     RowBox[{"\[CapitalOmega]", "*", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"2", "*", "p"}], "-", "1"}], ")"}]}]}]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Eta]_con", " ", 
     RowBox[{"(", "upper", ")"}]}], "<", "y2", "<", 
    RowBox[{"\[Upsilon]_lib", " ", 
     RowBox[{"(", "lower", ")"}]}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y14", " ", "=", 
    FractionBox[
     RowBox[{
      RowBox[{"x", "*", 
       RowBox[{"(", 
        RowBox[{"l", "+", 
         RowBox[{"k", "*", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", "p"}], "-", "1"}], ")"}]}]}], ")"}]}], "-", 
      RowBox[{"y2", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], "*", "k"}], "-", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "*", "p"}], "+", "1"}], ")"}], "*", "k"}]}], 
        ")"}]}]}], 
     RowBox[{"l", "+", 
      RowBox[{"k", "*", "p", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "*", "p"}], "-", "1"}], ")"}]}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{"\[Upsilon]_lib", " ", 
      RowBox[{"(", "lower", ")"}]}], "<", "y2", "<", 
     RowBox[{"\[Upsilon]_lib", " ", 
      RowBox[{"(", "upper", ")"}]}]}], ",", 
    RowBox[{"y1", "<", "y2"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y15", " ", "=", " ", 
    RowBox[{"x", "-", 
     RowBox[{"\[CapitalOmega]", "*", 
      FractionBox[
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", "k"}], 
       RowBox[{"l", "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}]}], 
   ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Upsilon]_lib", " ", 
     RowBox[{"(", "upper", ")"}]}], "<", "y2"}], "*)"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input",
 CellChangeTimes->{{3.9412973885619783`*^9, 3.941297452278665*^9}, {
   3.941297501961192*^9, 3.941297514012001*^9}, {3.941297617528672*^9, 
   3.9412976550795383`*^9}, {3.941297871638508*^9, 3.9412979638451633`*^9}, {
   3.9412982026327*^9, 3.941298261431922*^9}, {3.94129873492362*^9, 
   3.941298737773205*^9}, {3.941299047153089*^9, 3.941299163708432*^9}, {
   3.941299481173521*^9, 3.941299484019787*^9}, {3.941299578692587*^9, 
   3.9412996154841337`*^9}, {3.9412996734221087`*^9, 3.941299674464138*^9}, {
   3.9413000441334543`*^9, 3.9413000444881773`*^9}, {3.9413015323662252`*^9, 
   3.941301534146428*^9}, 3.9413139690976343`*^9, {3.941562737766728*^9, 
   3.941562788798688*^9}, {3.9415643804295588`*^9, 3.941564380737213*^9}, {
   3.94156494552973*^9, 3.941564945937149*^9}, {3.941636435754298*^9, 
   3.941636456177505*^9}, {3.941636529964381*^9, 3.9416365301906633`*^9}, {
   3.94163668046397*^9, 3.9416367028876038`*^9}, {3.941638902888667*^9, 
   3.941638918410672*^9}, 3.952864538549939*^9, {3.952864589607687*^9, 
   3.952864590863014*^9}, {3.952888644711211*^9, 3.952888645111751*^9}, {
   3.952888706951064*^9, 3.952888798705283*^9}, {3.952889596784197*^9, 
   3.952889600975346*^9}, {3.95288968560076*^9, 3.952889688767832*^9}, {
   3.9531098443429613`*^9, 3.953109991499791*^9}, {3.953110428618964*^9, 
   3.953110430148096*^9}, {3.953110477530634*^9, 3.953110478784069*^9}, {
   3.95311079153939*^9, 3.953110795258799*^9}},
 CellLabel->
  "In[250]:=",ExpressionUUID->"5602f688-3725-4245-9ea5-fa3fd50b249d"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"x", "=", "0.5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p", "=", "0.75"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"l", "=", "1"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"\[CapitalOmega]", " ", "=", " ", "0.25"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"k", "=", "0.51"}], ";"}]}], "Input",
 CellChangeTimes->{{3.94129796124518*^9, 3.94129817743688*^9}, {
   3.941298653996715*^9, 3.941298714533052*^9}, 3.941300186840918*^9, {
   3.9413002181515617`*^9, 3.941300250707059*^9}, {3.9413014851947393`*^9, 
   3.941301490167819*^9}, {3.941301538152516*^9, 3.9413015416770372`*^9}, {
   3.941302167726347*^9, 3.9413021680587683`*^9}, {3.941315494727557*^9, 
   3.941315496909103*^9}, {3.94162706475004*^9, 3.941627065777753*^9}, {
   3.941636463189331*^9, 3.941636484100425*^9}, {3.9416367541267157`*^9, 
   3.9416367857270613`*^9}, {3.952864616785441*^9, 3.9528646181219673`*^9}, 
   3.952888791055317*^9},
 CellLabel->
  "In[255]:=",ExpressionUUID->"90c41aa1-50aa-4a1e-b147-c21e01cf81ef"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"solsL", " ", "=", " ", 
   RowBox[{"Solve", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"y1", "==", "y12"}], "&&", 
      RowBox[{"y2", "==", "\[Eta]L"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"y1", ",", "y2"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"solsU", " ", "=", " ", 
   RowBox[{"Solve", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"y1", "==", "y12"}], "&&", 
      RowBox[{"y2", "==", "\[Eta]U"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"y1", ",", "y2"}], "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"nL", "=", " ", 
   RowBox[{"Round", "[", 
    RowBox[{
     RowBox[{"solsL", "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], ",", ".0001"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"nU", " ", "=", "  ", 
    RowBox[{"Round", "[", 
     RowBox[{
      RowBox[{"solsU", "[", 
       RowBox[{"[", 
        RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], ",", ".0001"}], 
     "]"}]}], ";"}], "\[IndentingNewLine]"}], "\n", 
 RowBox[{
  RowBox[{"t1", " ", "=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y11", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "0.25", ",", "nL", ",", "0.0001"}], "}"}]}], "]"}]}],
   ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"t2", "=", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"y12", ",", "y2"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"y2", ",", "nL", ",", "nU", ",", "0.0001"}], "}"}]}], "]"}]}], 
   ";"}], " "}], "\n", 
 RowBox[{
  RowBox[{"t3", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y13", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "nU", ",", "\[Upsilon]L", ",", "0.0001"}], "}"}]}], 
    "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"t4", "=", 
    RowBox[{"Table", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"y14", ",", "y2"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"y2", ",", "\[Upsilon]L", ",", "\[Upsilon]U", ",", "0.0001"}], 
       "}"}]}], "]"}]}], ";"}], " "}], "\n", 
 RowBox[{
  RowBox[{"t5", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y15", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "\[Upsilon]U", ",", "0.75", ",", "0.0001"}], "}"}]}],
     "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.94129796124518*^9, 3.94129817743688*^9}, {
   3.941298653996715*^9, 3.941298714533052*^9}, 3.941300186840918*^9, {
   3.9413002181515617`*^9, 3.941300250707059*^9}, {3.9413014851947393`*^9, 
   3.941301490167819*^9}, {3.941301538152516*^9, 3.9413015416770372`*^9}, {
   3.941302167726347*^9, 3.9413021680587683`*^9}, {3.941315494727557*^9, 
   3.941315496909103*^9}, {3.94162706475004*^9, 3.941627065777753*^9}, {
   3.941636463189331*^9, 3.941636484100425*^9}, {3.9416367541267157`*^9, 
   3.9416367857270613`*^9}, {3.952864616785441*^9, 3.9528646181219673`*^9}, {
   3.952888791055317*^9, 3.9528888174021683`*^9}, {3.9528895921900597`*^9, 
   3.952889593913999*^9}, {3.952889691739986*^9, 3.952889692403302*^9}, {
   3.953111315491036*^9, 3.953111333103931*^9}, {3.953111562671452*^9, 
   3.953111564721672*^9}},
 CellLabel->
  "In[260]:=",ExpressionUUID->"62d02844-abd6-4e6e-b737-9565685ad93b"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"Join", "[", 
    RowBox[{"t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"Export", "[", 
   RowBox[{"fileNameL", ",", "data", ",", "\"\<CSV\>\""}], "]"}], 
  ";"}], "\n"}], "Input",
 CellChangeTimes->{{3.941314646683414*^9, 3.941314647047428*^9}, {
   3.941314751520652*^9, 3.941314754770001*^9}, {3.941314792347958*^9, 
   3.941314793603355*^9}, {3.941314863482985*^9, 3.941314866118833*^9}, {
   3.9416368325560904`*^9, 3.941636840650711*^9}, 3.952888852318657*^9, {
   3.9528889685161057`*^9, 3.952888979432132*^9}},
 CellLabel->
  "In[269]:=",ExpressionUUID->"06c4aaa5-08a3-4993-b5cf-310e26192ad8"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
  "Determine", " ", "the", " ", "bound", " ", "where", " ", "the", " ", 
   "first", " ", "court", " ", "will", " ", "choose", " ", "between", " ", 
   "always", " ", "picking", " ", "con", " ", "and", " ", "an", " ", 
   "informative", " ", "lib"}], "*)"}]], "Input",
 CellChangeTimes->{
  3.952864583691907*^9, {3.9531114649209223`*^9, 
   3.953111472870489*^9}},ExpressionUUID->"bee8ff69-8c4c-46c2-b7dc-\
2ef82e10bce3"],

Cell[BoxData[
 RowBox[{"Clear", "[", "\"\<Global`*\>\"", "]"}]], "Input",
 CellLabel->
  "In[271]:=",ExpressionUUID->"0a298e3a-361d-475c-b2e0-743bc656d426"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"\[Eta]U", "=", 
    FractionBox[
     RowBox[{
      RowBox[{"x", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "p"}], "+", "1"}], ")"}], "*", "l"}], "+", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}], ")"}]}],
       "+", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "p"}], "-", "1"}], ")"}], "l"}], "+", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "p"}], "+", "1"}], ")"}], "*", "k"}]}], ")"}]}], "+", 
      RowBox[{"y1", "*", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], 
       RowBox[{"(", 
        RowBox[{"l", "-", "k"}], ")"}]}]}], 
     RowBox[{"p", 
      RowBox[{"(", 
       RowBox[{"l", "+", 
        RowBox[{"k", "*", 
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}], ")"}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Eta]_lib", " ", 
     RowBox[{"(", "upper", ")"}]}], ",", " ", 
    RowBox[{"y1", "<", "y2"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Eta]L", "=", " ", 
    FractionBox[
     RowBox[{
      RowBox[{"2", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"l", "*", "x"}], "+", 
         RowBox[{"k", "*", "\[CapitalOmega]"}]}], ")"}]}], "+", 
      RowBox[{"y1", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], 
       RowBox[{"(", 
        RowBox[{"l", "-", "k"}], ")"}]}]}], 
     RowBox[{"l", "-", 
      RowBox[{"k", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Eta]_lib", " ", 
     RowBox[{"(", "lower", ")"}]}], ",", " ", 
    RowBox[{"y1", "<", "y2"}]}], " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Upsilon]L", "=", 
    RowBox[{"Round", "[", " ", 
     RowBox[{
      RowBox[{"x", "-", 
       RowBox[{"\[CapitalOmega]", "*", 
        FractionBox[
         RowBox[{
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", 
          "k"}], 
         RowBox[{"l", "+", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}], 
      ",", "0.0001"}], "]"}]}], ";"}], "  ", 
  RowBox[{"(*", 
   RowBox[{"\[Upsilon]_lib", " ", 
    RowBox[{"(", "lower", ")"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"\[Upsilon]U", " ", "=", " ", 
    RowBox[{"Round", "[", 
     RowBox[{
      RowBox[{"x", "+", 
       RowBox[{"\[CapitalOmega]", "*", 
        FractionBox[
         RowBox[{
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "l"}], "-", 
          "k"}], 
         RowBox[{"l", "-", 
          RowBox[{
           RowBox[{"(", 
            RowBox[{
             RowBox[{"2", "*", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}], 
      ",", "0.0001"}], "]"}]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{"\[Upsilon]_lib", " ", 
    RowBox[{"(", "lower", ")"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y11", " ", "=", " ", 
    RowBox[{"x", "+", 
     RowBox[{"\[CapitalOmega]", "*", 
      FractionBox[
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", "k"}], 
       RowBox[{"l", "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{
           RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "k"}]}]]}]}]}], ";"}], 
  
  RowBox[{"(*", 
   RowBox[{"y2", "<", 
    RowBox[{"\[Upsilon]_con", " ", 
     RowBox[{"(", "lower", ")"}]}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y12", " ", "=", " ", 
    FractionBox[
     RowBox[{
      RowBox[{"x", "*", 
       RowBox[{"(", 
        RowBox[{"l", "+", 
         RowBox[{"k", "*", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}], ")"}]}], "-", 
      RowBox[{"y2", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", 
       RowBox[{"(", 
        RowBox[{"1", "-", "p"}], ")"}], "*", "k"}], "+", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "l"}], "+", 
         RowBox[{"k", "*", 
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", 
             RowBox[{"p", "^", "2"}]}], "-", 
            RowBox[{"2", "p"}], "+", "1"}], ")"}]}]}], ")"}]}]}], 
     RowBox[{"l", "+", 
      RowBox[{"k", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "p"}]}]]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{"\[Upsilon]_con", " ", 
      RowBox[{"(", "lower", ")"}]}], "<", "y2", "<", 
     RowBox[{"\[Upsilon]_con", " ", 
      RowBox[{"(", "upper", ")"}]}]}], ",", " ", 
    RowBox[{"y1", ">", "y2"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y13", " ", "=", " ", 
    RowBox[{"x", "+", 
     RowBox[{"\[CapitalOmega]", "*", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"2", "p"}], "-", "1"}], ")"}]}]}]}], ";"}], " ", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"\[Upsilon]_con", " ", 
     RowBox[{"(", "upper", ")"}]}], "<", "y2", "<", 
    RowBox[{"\[Eta]_lib", " ", 
     RowBox[{"(", "lower", ")"}]}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"y14", " ", "=", " ", 
    FractionBox[
     RowBox[{
      RowBox[{"l", "*", "x"}], "-", 
      RowBox[{"y2", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "p", "*", "k"}], "+", 
      RowBox[{"\[CapitalOmega]", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "l"}], "-", 
         RowBox[{"k", "*", "2", "*", "p", "*", 
          RowBox[{"(", 
           RowBox[{"1", "-", "p"}], ")"}]}]}], ")"}]}]}], 
     RowBox[{"l", "-", 
      RowBox[{"k", "*", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "*", "p"}]}]]}], ";"}], 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
     RowBox[{"\[Eta]_lib", " ", 
      RowBox[{"(", "lower", ")"}]}], "<", "y2", "<", 
     RowBox[{"\[Eta]_lib", " ", 
      RowBox[{"(", "upper", ")"}]}]}], ",", " ", 
    RowBox[{"y1", "<", "y2"}]}], "*)"}]}], "\n", 
 RowBox[{"y15", " ", "=", 
  RowBox[{"x", "+", 
   RowBox[{"\[CapitalOmega]", "*", 
    FractionBox[
     RowBox[{
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "l"}], "-", "k"}], 
     RowBox[{"l", "-", 
      RowBox[{
       RowBox[{"(", 
        RowBox[{
         RowBox[{"2", "p"}], "-", "1"}], ")"}], "k"}]}]], 
    RowBox[{"(*", 
     RowBox[{
      RowBox[{"\[Eta]_lib", " ", 
       RowBox[{"(", "upper", ")"}]}], "<", "y2"}], "*)"}]}]}]}]}], "Input",
 CellChangeTimes->{{3.941563355954958*^9, 3.9415633681546307`*^9}, {
   3.94156364585472*^9, 3.941563719449774*^9}, {3.941564349540041*^9, 
   3.941564350205162*^9}, {3.941565415964561*^9, 3.941565500434284*^9}, {
   3.94163232232828*^9, 3.9416325763039227`*^9}, {3.941632635106784*^9, 
   3.941632650685248*^9}, 3.941632684015532*^9, {3.941632783705431*^9, 
   3.941632822610938*^9}, {3.941632858450902*^9, 3.9416328647067223`*^9}, {
   3.941636944688113*^9, 3.941636947617508*^9}, {3.941637060693325*^9, 
   3.941637127535*^9}, 3.941637159638197*^9, {3.9416389281724586`*^9, 
   3.941638942914267*^9}, {3.9528646636528997`*^9, 3.952864676360793*^9}, 
   3.952888866842536*^9, {3.952889565699835*^9, 3.952889573022603*^9}, 
   3.953109505074855*^9, {3.953109600292042*^9, 3.953109635147448*^9}, {
   3.9531097087558527`*^9, 3.9531097091218452`*^9}, {3.953109811500031*^9, 
   3.953109830011331*^9}, {3.9531107726581373`*^9, 3.953110774227586*^9}, {
   3.953111519690237*^9, 3.9531115381798677`*^9}, {3.953111578676941*^9, 
   3.953111695784045*^9}},
 CellLabel->
  "In[272]:=",ExpressionUUID->"55b000c1-0409-4e0d-98c5-c57191e058c0"],

Cell[BoxData[
 RowBox[{"x", "+", 
  FractionBox[
   RowBox[{
    RowBox[{"(", 
     RowBox[{
      RowBox[{"-", "k"}], "+", 
      RowBox[{"l", " ", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"-", "1"}], "+", 
         RowBox[{"2", " ", "p"}]}], ")"}]}]}], ")"}], " ", 
    "\[CapitalOmega]"}], 
   RowBox[{"l", "-", 
    RowBox[{"k", " ", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{"-", "1"}], "+", 
       RowBox[{"2", " ", "p"}]}], ")"}]}]}]]}]], "Output",
 CellChangeTimes->{3.95311171372875*^9},
 CellLabel->
  "Out[280]=",ExpressionUUID->"75d09232-d56a-4020-a758-f277f9c0b8a6"]
}, Open  ]],

Cell[BoxData[{
 RowBox[{
  RowBox[{"x", "=", "0.5"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"p", "=", "0.75"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"l", "=", "1"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"\[CapitalOmega]", " ", "=", " ", "0.25"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"k", "=", "0.51"}], ";"}]}], "Input",
 CellLabel->
  "In[281]:=",ExpressionUUID->"c0edd97c-f9f8-4182-8ce0-2b285b644888"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"solsL", " ", "=", " ", 
   RowBox[{"Solve", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"y1", "==", "y14"}], "&&", 
      RowBox[{"y2", "==", "\[Eta]L"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"y1", ",", "y2"}], "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"solsU", " ", "=", " ", 
   RowBox[{"Solve", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"y1", "==", "y14"}], "&&", 
      RowBox[{"y2", "==", "\[Eta]U"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"y1", ",", "y2"}], "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"nL", "=", " ", 
   RowBox[{"Round", "[", 
    RowBox[{
     RowBox[{"solsL", "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], ",", ".0001"}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"nU", " ", "=", "  ", 
   RowBox[{"Round", "[", 
    RowBox[{
     RowBox[{"solsU", "[", 
      RowBox[{"[", 
       RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], ",", ".0001"}], 
    "]"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.941632692882309*^9, 3.9416327124944696`*^9}, 
   3.941636964592353*^9, {3.941637020975359*^9, 3.941637038214487*^9}, 
   3.941637107549663*^9, 3.94163715115945*^9, {3.9416371822827177`*^9, 
   3.94163718662306*^9}, {3.952888872830014*^9, 3.9528888962889357`*^9}, {
   3.9528896248756227`*^9, 3.952889625749712*^9}},
 CellLabel->
  "In[286]:=",ExpressionUUID->"4d4851a4-2e97-48c1-a42d-b521fe630459"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"t1", " ", "=", " ", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y11", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "0.25", ",", "\[Upsilon]L", ",", "0.0001"}], "}"}]}],
     "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t2", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y12", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "\[Upsilon]L", ",", "\[Upsilon]U", ",", "0.0001"}], 
      "}"}]}], "]"}]}], ";"}], "\n", 
 RowBox[{
  RowBox[{"t3", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y13", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "\[Upsilon]U", ",", "nL", ",", "0.0001"}], "}"}]}], 
    "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t4", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y14", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "nL", ",", "nU", ",", "0.0001"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"t5", "=", 
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"y15", ",", "y2"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"y2", ",", "nU", ",", "0.75", ",", "0.0001"}], "}"}]}], "]"}]}],
   ";"}]}], "Input",
 CellChangeTimes->{{3.9416372336423492`*^9, 3.941637262689488*^9}, {
   3.941637300292555*^9, 3.94163733022307*^9}, 3.94163742659669*^9, {
   3.941638528807708*^9, 3.941638530085478*^9}, {3.952888472514893*^9, 
   3.952888474340211*^9}, 3.952888901386763*^9, {3.952889575644301*^9, 
   3.952889577176504*^9}},
 CellLabel->
  "In[290]:=",ExpressionUUID->"ba64bba4-d467-4058-af3e-8f6d8df70522"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"Join", "[", 
    RowBox[{"t1", ",", "t2", ",", "t3", ",", "t4", ",", "t5"}], "]"}]}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"SetDirectory", "[", 
   RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"fileNameU", "=", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"StringDrop", "[", 
       RowBox[{
        RowBox[{"Directory", "[", "]"}], ",", 
        RowBox[{"-", "5"}]}], "]"}], ",", 
      "\"\<Data/Split_Aversion_upper_bound.csv\>\""}], "}"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Export", "[", 
   RowBox[{"fileNameU", ",", "data", ",", "\"\<CSV\>\""}], "]"}], 
  ";"}]}], "Input",
 CellChangeTimes->{{3.952888908968768*^9, 3.952888917772873*^9}, {
  3.952888982146165*^9, 3.952888982697225*^9}, {3.952956715887177*^9, 
  3.952956722709041*^9}},
 CellLabel->
  "In[295]:=",ExpressionUUID->"ff293ab3-d46c-4f4c-8e85-fd13092345d1"]
},
WindowSize->{Full, Full},
WindowMargins->{{257, Automatic}, {Automatic, 0}},
FrontEndVersion->"13.2 for Mac OS X ARM (64-bit) (November 18, 2022)",
StyleDefinitions->"Default.nb",
ExpressionUUID->"d1e2b2e4-3e84-41ba-938c-e90e6bb10116"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 6086, 169, 317, "Input",ExpressionUUID->"7d4ec211-9b62-4935-a3bd-c472162f6f2f"],
Cell[6647, 191, 5678, 157, 253, "Input",ExpressionUUID->"5602f688-3725-4245-9ea5-fa3fd50b249d"],
Cell[12328, 350, 1075, 22, 115, "Input",ExpressionUUID->"90c41aa1-50aa-4a1e-b147-c21e01cf81ef"],
Cell[13406, 374, 3374, 97, 220, "Input",ExpressionUUID->"62d02844-abd6-4e6e-b737-9565685ad93b"],
Cell[16783, 473, 713, 16, 73, "Input",ExpressionUUID->"06c4aaa5-08a3-4993-b5cf-310e26192ad8"],
Cell[17499, 491, 468, 10, 30, "Input",ExpressionUUID->"bee8ff69-8c4c-46c2-b7dc-2ef82e10bce3"],
Cell[17970, 503, 156, 3, 30, "Input",ExpressionUUID->"0a298e3a-361d-475c-b2e0-743bc656d426"],
Cell[CellGroupData[{
Cell[18151, 510, 8851, 273, 388, "Input",ExpressionUUID->"55b000c1-0409-4e0d-98c5-c57191e058c0"],
Cell[27005, 785, 603, 21, 53, "Output",ExpressionUUID->"75d09232-d56a-4020-a758-f277f9c0b8a6"]
}, Open  ]],
Cell[27623, 809, 462, 13, 115, "Input",ExpressionUUID->"c0edd97c-f9f8-4182-8ce0-2b285b644888"],
Cell[28088, 824, 1452, 41, 94, "Input",ExpressionUUID->"4d4851a4-2e97-48c1-a42d-b521fe630459"],
Cell[29543, 867, 1770, 52, 115, "Input",ExpressionUUID->"ba64bba4-d467-4058-af3e-8f6d8df70522"],
Cell[31316, 921, 989, 28, 149, "Input",ExpressionUUID->"ff293ab3-d46c-4f4c-8e85-fd13092345d1"]
}
]
*)

